public class gre {
import java.util.Scanner;

    public class Demo88 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            double a,b,c,d,e,f;
            double x,y;
            System.out.println("请输入a,b,e的值:");
            a = scanner.nextDouble();
            b = scanner.nextDouble();
            e = scanner.nextDouble();
            System.out.println("请输入c,d,f的值");
            c = scanner.nextDouble();
            d = scanner.nextDouble();
            f = scanner.nextDouble();
            if(a*d-b*c==0){
                System.out.println("此方程组无解");
            }else {
                x = (e*d-b*f)/(a*d-b*c);
                y = (a*f-e*c)/(a*d-b*c);
                System.out.println("x = "+x);
                System.out.println("y = "+y);
            }
        }
    }

}
